<?php

namespace App\Http\Controllers\Seller;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class UploadController extends BaseController
{
    //
    public function index(Request $request)
    {
        $file = $request->file('img');
        $path = $file->store('',['disk'=>'seller']);
        $url = Storage::disk('seller')->url($path);
        $fileName = $file->getClientOriginalName();
        return $this->success([
            'path'=>$path,
            'filename'=>$fileName,
            'url'=>$url
        ]);

    }
}
